/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.germinus.telcoblocks.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.germinus.telcoblocks.Enlace;
import org.germinus.telcoblocks.NodoSERVICIOS;
import org.germinus.telcoblocks.SERVICIOS;
import org.germinus.telcoblocks.TelcoblocksPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>SERVICIOS</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.germinus.telcoblocks.impl.SERVICIOSImpl#getNodos <em>Nodos</em>}</li>
 *   <li>{@link org.germinus.telcoblocks.impl.SERVICIOSImpl#getEnlaces <em>Enlaces</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SERVICIOSImpl extends EObjectImpl implements SERVICIOS {
	/**
	 * The cached value of the '{@link #getNodos() <em>Nodos</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNodos()
	 * @generated
	 * @ordered
	 */
	protected EList<NodoSERVICIOS> nodos;

	/**
	 * The cached value of the '{@link #getEnlaces() <em>Enlaces</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEnlaces()
	 * @generated
	 * @ordered
	 */
	protected EList<Enlace> enlaces;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SERVICIOSImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return TelcoblocksPackage.Literals.SERVICIOS;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<NodoSERVICIOS> getNodos() {
		if (nodos == null) {
			nodos = new EObjectContainmentEList<NodoSERVICIOS>(NodoSERVICIOS.class, this, TelcoblocksPackage.SERVICIOS__NODOS);
		}
		return nodos;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Enlace> getEnlaces() {
		if (enlaces == null) {
			enlaces = new EObjectContainmentEList<Enlace>(Enlace.class, this, TelcoblocksPackage.SERVICIOS__ENLACES);
		}
		return enlaces;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case TelcoblocksPackage.SERVICIOS__NODOS:
				return ((InternalEList<?>)getNodos()).basicRemove(otherEnd, msgs);
			case TelcoblocksPackage.SERVICIOS__ENLACES:
				return ((InternalEList<?>)getEnlaces()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case TelcoblocksPackage.SERVICIOS__NODOS:
				return getNodos();
			case TelcoblocksPackage.SERVICIOS__ENLACES:
				return getEnlaces();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case TelcoblocksPackage.SERVICIOS__NODOS:
				getNodos().clear();
				getNodos().addAll((Collection<? extends NodoSERVICIOS>)newValue);
				return;
			case TelcoblocksPackage.SERVICIOS__ENLACES:
				getEnlaces().clear();
				getEnlaces().addAll((Collection<? extends Enlace>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case TelcoblocksPackage.SERVICIOS__NODOS:
				getNodos().clear();
				return;
			case TelcoblocksPackage.SERVICIOS__ENLACES:
				getEnlaces().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case TelcoblocksPackage.SERVICIOS__NODOS:
				return nodos != null && !nodos.isEmpty();
			case TelcoblocksPackage.SERVICIOS__ENLACES:
				return enlaces != null && !enlaces.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //SERVICIOSImpl
